package com.theaf.basemodule.common.model.mesTemplate;

import com.theaf.core.annotation.FieldCn;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

@ApiModel("通知范围")
@Entity
@Table(name = "mes_notify_scope")
@Data
@AllArgsConstructor
@NoArgsConstructor
@DynamicUpdate
@DynamicInsert
public class MesNotifyScope {
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.SEQUENCE,generator = "user_id_req")
    @SequenceGenerator(name = "user_id_req", sequenceName = "sys_req")
    @FieldCn(value = "id")
    private Long id;
    @Column(name = "template_id")
    @FieldCn(value = "模版id")
    private Long templateId;
    @Column(name = "type")
    @FieldCn(value = "类型",note = "1机构联系人2机构岗位3机构责任人4机构开拓人5手机或微信或用户")
    private Integer type;
    public final static int TYPE_ORGAN_CONTACT = 1;//机构联系人
    public final static int TYPE_ORGAN_POS = 2;//机构岗位
    public final static int TYPE_ORGAN_RES = 3;//机构责任人
    public final static int TYPE_ORGAN_PON = 4;//机构开拓人
    public final static int TYPE_OTHER = 5;//手机或微信或用户
    @Column(name = "org_id")
    @FieldCn(value = "机构ID")
    private Long orgId;
    @Column(name = "childed")
    @FieldCn(value = "是否包括下级")
    private Boolean childed;
    @Column(name = "contact")
    @FieldCn(value = "联系方式")
    private String contact;
    @Column(name = "pos_id")
    @FieldCn(value = "岗位ID")
    private Long posId;
    @Column(name = "user_id")
    @FieldCn(value = "用户ID")
    private Long userId;
    @Column(name = "phone")
    @FieldCn(value = "手机")
    private String phone;
    @Column(name = "weixin")
    @FieldCn(value = "微信")
    private String weixin;
}
